<%--
  Created by IntelliJ IDEA.
  User: 10195
  Date: 2024/6/28
  Time: 19:40
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
    <head>
        <title>Title</title>
    </head>
    <body>
        <input type="button" value="新增" id="add"><br>
        <hr>
        <table border="1" cellspacing="0">
            <tr>
                <th>序号</th>
                <th>品牌名称</th>
                <th>企业名称</th>
                <th>排序</th>
                <th>品牌介绍</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${brands}" var="brand" varStatus="xuhao">
                <tr align="center">
                    <td>${xuhao.count}</td>
                    <td>${brand.brandName}</td>
                    <td>${brand.companyName}</td>
                    <td>${brand.ordered}</td>
                    <td>${brand.description}</td>
                    <c:choose>
                        <c:when test="${brand.status==1}">
                            <td>启用</td>
                        </c:when>
                        <c:otherwise>
                            <td>禁用</td>
                        </c:otherwise>
                    </c:choose>
                    <td><a href="/BrandDemo/selectByIdServlet?id=${brand.id}">修改</a> <a href="#">删除</a></td>
                </tr>
            </c:forEach>
        </table>
        <script>
            document.getElementById("add").onclick = function () {
                //addBrand.jsp的路径
                location.href = "/BrandDemo/addBrand.jsp";
            }
        </script>
    </body>
</html>